package com.activities;


import android.app.Activity;
import com.example.santiagotur.R;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnCloseListener;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnOpenedListener;


public class CreateSliderClass {

    public static SlidingMenu Menu;

    private final Activity activityPrincipal;

    public CreateSliderClass(Activity menuActivity) {

        super();

        activityPrincipal = menuActivity;

    }

    public SlidingMenu Create() {

        int shadow = R.drawable.shadow;
        SlidingMenu sMenu = new SlidingMenu(activityPrincipal);
        sMenu.setMode(SlidingMenu.LEFT);

        sMenu.setShadowWidthRes(R.dimen.shadow_width);
        sMenu.setShadowDrawable(shadow);
        sMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
        sMenu.setFadeDegree(0.35f);
        sMenu.attachToActivity(activityPrincipal, SlidingMenu.SLIDING_CONTENT);
        //
        sMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
        sMenu.setMenu(R.layout.menu);

        CreateSliderClass.Menu = sMenu;

        sMenu.setOnOpenedListener(new OnOpenedListener() {

            @Override
            public void onOpened() {

            }
        });
        sMenu.setOnCloseListener(new OnCloseListener() {

            @Override
            public void onClose() {

            }
        });

        return sMenu;
    }

    public SlidingMenu getMenu() {

        return Menu;
    }

}
